import prism from "../static/js/prism"

const emoji = require("markdown-it-emoji");
const container = require('markdown-it-container')

const markdownit = require('markdown-it')({
  langPrefix:   'language-',
  highlight: function (str, lang) {
    var strHtml = ''
    try {
      strHtml = prism.highlight(str,prism.languages[lang],lang)
    } catch (error) {
      strHtml = str
    }
    return strHtml;
  }
});
markdownit.use(emoji);
markdownit.use(container);

export default markdownit